package com.TiaoJianJiaZai;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * 作者: LCG
 * 日期: 2020/3/6 23:05
 * 描述:
 */
public class MyConditional implements Condition {
    @Override
    public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
        System.out.println(conditionContext.getEnvironment().getProperty("my.tiaojian"));
        boolean ttt = conditionContext.getEnvironment().getProperty("my.tiaojian").contains("TTT");
        return ttt;
    }
}

